IF EXISTS ( SELECT 'X' FROM sys.views WHERE name = 'vDDLActivity' AND schema_id = 1 )
BEGIN
     DROP VIEW dbo.vDDLActivity
END
GO

CREATE VIEW dbo.vDDLActivity

AS
/*
 *
 * vDDLActivity
 *
 * Purpose:      
 *
 * Inputs:       
 *
 * Assumes:      
 *
 * Effects:      
 *
 * Returns:      
 *
 * Calling
 * Application:  
 *
 * Note(s):      
 *
 * Author(s):    NOVA Concepts Ltd.
 *
 * Change Log:   Initial Release, 05/30/2009, 1.00.0000
 *
 */
SELECT DDLActivityId    = EventLogId,
       DDLActivityDt    = LogDt,
       HostName,
       AppName,
       LoginName,
       DatabaseUserName,
       EventType        = MiscVC1,
       DatabaseName,
       SchemaName       = MiscVC2,
       ObjectName       = MiscVC3,
       ObjectType       = MiscVC4,
       SPID,
       TSQLCommand      = TraceText 
FROM   dbo.EventLog 
WHERE  LogByApp          = 'LogAllDDL'
AND    LogByAppSubSystem = 'InsDDLActivity'
GO
